package com.que.owen.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;
import java.util.Map;

@Document
@NoArgsConstructor
@EqualsAndHashCode
@AllArgsConstructor
@Data
public class Taxonomy {
    @Id
    ObjectId objectId;
    @Field("_pid")
    ObjectId objectPid;
    String id;
    String pid;
    String taxonomyId;
    String name;
    String type;
    String style;
    String nodeType;
    String datasourceName;
    Object metadata;
    String owner;
    Date expressTime;
    String rule;
    Double price;
    String description;
    Integer datasourceId;
    CheckedEnum checked;
    String dataType;

    Map<String, String> permission;

    public String getObjectId() {
        return objectId.toHexString();
    }

    public String getObjectPid() {
        return objectPid.toHexString();
    }
}
